<?php
/**
 * @copyright   Copyright (c) 2017 https://www.sapixx.com All rights reserved.
 * @license     Licensed (http://www.apache.org/licenses/LICENSE-2.0).
 * @author      pillar<ltmn@qq.com>
 * 付款验证
 */
namespace app\allwin\validate;
use think\Validate;

class Dopay extends Validate{

    protected $rule = [
        'member_miniapp_id' => 'require|number',
        'store_id'          => 'require|number',
        'user_couponr_id'   => 'integer',
        'coupon_id'         => 'require|integer',
        'coupon_ids'        => 'array',
        'money'             => 'require|float|>:0',
        'amount'            => 'require|float',
        'telphone'          => 'require|mobile',
    ];
    protected $message = [
        'member_miniapp_id' => '应用验证失败',
        'store_id'          => '店铺不存在',
        'user_couponr_id'   => '优惠券不存在',
        'coupon_id'         => '请选择可用优惠券',
        'coupon_ids'        => '请选择可领优惠券',
        'money'             => '请输入付款金额',
        'amount'            => '请输入支付金额',
        'telphone'          => '请输入正确的手机号',
    ];

    protected $scene = [
        'gopay'  => ['member_miniapp_id', 'store_id', 'user_couponr_id', 'money', 'amount'],
        'coupon' => ['member_miniapp_id', 'coupon_id'],
        'goods'  => ['shop_id','telphone'],
        'ecard'  => ['member_miniapp_id','card_id','uid'],
        'agent'  => ['member_miniapp_id','uid'],
    ];
}